package gui;

import java.awt.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.swing.*;
import javax.swing.border.*;

public class BorderTest {

    public static void main(String[] args) {
        Runnable r = new Runnable() {

            @Override
            public void run() {
                JPanel gui = new JPanel(new GridLayout(2,0,5,5));
                gui.setBorder(new EmptyBorder(10,10,10,10));
                gui.setBackground(new Color(0xBDECB6));

                AbstractBorder brdrLeft = new TextBubbleBorder(Color.BLACK,2,16,16);
                AbstractBorder brdrRight = new TextBubbleBorder(Color.BLACK,2,16,16,false);

                JLabel l1 = new JLabel("Label 1", JLabel.CENTER);
                l1.setBorder(brdrRight);
                gui.add(l1);
//
//                JLabel l2 = new JLabel("Label 2");
//                l2.setBorder(brdrLeft);
//                l2.setBackground(Color.YELLOW);
////                l2.setOpaque(true);
//                gui.add(l2);
//
                JPanel p1 = new JPanel();
                p1.add(new JLabel("Panel 1"));
                p1.setBorder(brdrRight);
                p1.setOpaque(false);
                gui.add(p1);
//
//                JPanel p2 = new JPanel();
//                p2.add(new JLabel("Panel 2"));
//                p2.setBorder(brdrLeft);
//                gui.add(p2);

                JOptionPane.showMessageDialog(null, gui);
            }
        };
        // Swing GUIs should be created and updated on the EDT
        // http://docs.oracle.com/javase/tutorial/uiswing/concurrency/initial.html
        SwingUtilities.invokeLater(r);
    }

}